﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;

namespace WikiWiki.Models
{
    public class WikiInitializer : DropCreateDatabaseIfModelChanges<WikiContext>
    {
        protected override void Seed(WikiContext context)
        {
            var wikis = new List<Wiki> {  
  
                     new Wiki { userID = 1,
                                Title = "Install Procedure",
                                Category = "Install",
                                Description = "Here is where i would put the install page...",
                                ReleaseDate = DateTime.Now,
                                Count = 0},  

                     new Wiki { userID = 1,
                                Title = "Introduction",
                                Category = "Introduction",
                                Description = "Here is where i would put some intro wiki page",
                                ReleaseDate = DateTime.Now,
                                Count = 0},    
  
                     new Wiki { userID = 1,
                                Title = "Wiki site basics",
                                Category = "Introduction",
                                Description = "Here is what you do...",
                                ReleaseDate = DateTime.Now,
                                Count = 0}, 

                    new Wiki { userID = 1,
                                Title = "Setting up security",
                                Category = "Security",
                                Description = "Here is how to set up security...",
                                ReleaseDate = DateTime.Parse("2012-12-3"),
                                Count = 0}, 
                 };

            wikis.ForEach(d => context.Wiki.Add(d));
        }
    }
}